/*
* Copyright (c) 2008, Vladimir Gumenuk
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*     * Redistributions of source code must retain the above copyright
*       notice, this list of conditions and the following disclaimer.
*     * Redistributions in binary form must reproduce the above copyright
*       notice, this list of conditions and the following disclaimer in the
*       documentation and/or other materials provided with the distribution.
*     * Neither the name of the copyright holder nor the
*       names of its contributors may be used to endorse or promote products
*       derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// RealGNX4LibView.h : interface of the CRealGNX4LibView class
//


#pragma once
#include "afxwin.h"
#include "afxcmn.h"
#include "GNXEdit.h"

class CRealGNX4LibView : public CFormView
{
protected: // create from serialization only
	CRealGNX4LibView();
	DECLARE_DYNCREATE(CRealGNX4LibView)

public:
	enum{ IDD = IDD_REALGNX4LIB_FORM };

// Attributes
public:
	CRealGNX4LibDoc* GetDocument() const;

// Operations
public:
    void OnPresetSelected( UINT iIdx );

// Overrides
public:
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
	virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
	virtual void OnInitialUpdate(); // called first time after construct

// Implementation
public:
	virtual ~CRealGNX4LibView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

protected:
    void InitCombos();
    void UpdateView( UINT iPresetIdx );
    void UpdateWhammyModView( LPPRESET p );
    void UpdateSompBoxView( LPPRESET p );
    void UpdateNoiseGateView( LPPRESET p );
    void UpdateChorusModView( LPPRESET p );
    void UpdateDelayView( LPPRESET p );
    void UpdateReverbView( LPPRESET p );
    void UpdateExpPdlView( LPPRESET p );
    void UpdateLFOView( LPPRESET p );
    void UpdateCtrlAView( LPPRESET p );

// Generated message map functions
protected:
    afx_msg void OnEnChangeCompThreshEdit();
    afx_msg void OnSelChangeWhammyModule();
    afx_msg void OnSelChangeStompBox();
    afx_msg void OnSelChangeNoiseGateType();
    afx_msg void OnSelChangeChorusModType();

	DECLARE_MESSAGE_MAP()

protected:
    UINT         m_iCurrentPresetIdx;

    CEdit        m_editPresetName;
    CString      m_csPresetName;

    // Amp channel 1
    CComboBox    m_cmbChan1Amp;
    CComboBox    m_cmbChan1Cab;
    CGNXEdit     m_editAmp1Gain;
    CGNXEdit     m_editAmp1Bass;
    CGNXEdit     m_editAmp1Middle;
    CGNXEdit     m_editAmp1Treble;
    CGNXEdit     m_editAmp1Level;
    CGNXEdit     m_editCab1Tune;
    CGNXEdit     m_editAmp1BassFreq;
    CGNXEdit     m_editAmp1MiddleFreq;
    CGNXEdit     m_editAmp1TrebleFreq;
    CGNXEdit     m_editAmp1Presence;
    CGNXCheck    m_chkEQ1;

    // Amp channel 2
    CComboBox    m_cmbChan2Amp;
    CComboBox    m_cmbChan2Cab;
    CGNXEdit     m_editAmp2Gain;
    CGNXEdit     m_editAmp2Bass;
    CGNXEdit     m_editAmp2Middle;
    CGNXEdit     m_editAmp2Treble;
    CGNXEdit     m_editAmp2Level;
    CGNXEdit     m_editCab2Tune;
    CGNXEdit     m_editAmp2BassFreq;
    CGNXEdit     m_editAmp2MiddleFreq;
    CGNXEdit     m_editAmp2TrebleFreq;
    CGNXEdit     m_editAmp2Presence;
    CGNXCheck    m_chkEQ2;

    // WARP channel
    CComboBox   m_cmbActiveChannel;
    CGNXEdit    m_editWarpAmp;
    CGNXEdit    m_editWarpCab;
    CGNXEdit    m_editWarpZ;

    // WAH
    CGNXCheck   m_chkWAH;
    CComboBox   m_cmbWAHType;
    CGNXEdit    m_editWAHPedal;
    CGNXEdit    m_editWAHPedalMin;
    CGNXEdit    m_editWAHPedalMax;
    CGNXCheck   m_chkPickupEnable;
    CComboBox   m_cmbPickupType;
    CGNXEdit    m_editPresetLevel;
    
    // COMPRESSOR
    CGNXCheck   m_chkCOMPEnable;
    CComboBox   m_cmbCOMPAtack;
    CComboBox   m_cmbCOMPRatio;
    CGNXEdit    m_editCOMPThreshould;
    CGNXEdit    m_editCOMPGain;

    // WHAMMY/IPS/TALKER
    CGNXCheck   m_chkWHAMMYEnable;
    CComboBox   m_cmbWHAMMYModule;
    CComboBox   m_cmbWHAMMYPitchBend;
    CGNXEdit    m_editWHAMMYPedal;
    CGNXEdit    m_editWHAMMYLevel;
    CComboBox   m_cmbIPSAmount;
    CComboBox   m_cmbIPSScale;
    CComboBox   m_cmbIPSKey;
    CStatic     m_txtWHAMMYParam1;
    CStatic     m_txtWHAMMYParam2;
    CStatic     m_txtIPSKey;
    CStatic     m_txtWHAMMYLevel;
    CGNXEdit    m_editDETUNERAmount; // for detuner and shift

    // STOMPBOX
    CGNXCheck   m_chkSTOMPBOXEnable;
    CComboBox   m_cmbSTOMPBOXType;
    CStatic     m_txtSTBOXGain;
    CGNXEdit    m_editSTBOXGain;
    CStatic     m_txtSTBOXParam1;
    CGNXEdit    m_editSTBOXParam1;
    CStatic     m_txtSTBOXParam2;
    CGNXEdit    m_editSTBOXParam2;
    CStatic     m_txtSTBOXLoFreq;
    CGNXEdit    m_editSTBOXLoFreq;
    CStatic     m_txtSTBOXHiLevel;
    CGNXEdit    m_editSTBOXHiLevel;
    CGNXEdit    m_editSTBOXLevel;

    // NOISE GATE
    CGNXCheck   m_chkNGATEEnable;
    CComboBox   m_cmbNGATEType;
    CGNXEdit    m_editNGATEThresh;
    CGNXEdit    m_editNGATEAttack;
    CGNXEdit    m_editNGATESensitivity;
    CStatic     m_txtPulckSensitivity;

    // CHORUS/MOD
    CGNXCheck   m_chkMODEnable;
    CComboBox   m_cmbMODType;
    CStatic     m_txtMODParam1;
    CGNXEdit    m_editMODParam1;
    CStatic     m_txtMODParam2;
    CGNXEdit    m_editMODParam2;
    CStatic     m_txtMODParam3;
    CGNXEdit    m_editMODParam3;
    CStatic     m_txtMODParam4;
    CGNXEdit    m_editMODParam4;
    CStatic     m_txtMODParam5;
    CGNXEdit    m_editMODParam5;
    CStatic     m_txtMODLevel;
    CGNXEdit    m_editMODLevel;
    CComboBox   m_cmbMODWavFromType;
    
    // DELAY
    CGNXCheck   m_chkDELAYEnable;
    CComboBox   m_cmbDELAYType;
    CGNXEdit    m_editDELAYTime;
    CGNXEdit    m_editDELAYFeedback;
    CGNXEdit    m_editDELAYThresh;
    CGNXEdit    m_editDELAYAttenuation;
    CGNXEdit    m_editDELAYBalance;
    CGNXEdit    m_editDELAYSpread;
    CGNXEdit    m_editDELAYLevel;
    
    // REVERB
    CGNXCheck   m_chkREVERBEnable;
    CComboBox   m_cmbREVERBType;
    CGNXEdit    m_editREVERBPredelay;
    CGNXEdit    m_editREVERBDecay;
    CGNXEdit    m_editREVERBDumping;
    CGNXEdit    m_editREVERBBalance;
    CGNXEdit    m_editREVERBLevel;

    // EXPRESSION PEDAL ASSIGN
    CComboBox   m_cmbEXPPdl1Assgn;
    CComboBox   m_cmbEXPPdl2Assgn;
    CComboBox   m_cmbEXPPdl3Assgn;
    CGNXEdit    m_editExpPdl1Min;
    CGNXEdit    m_editExpPdl1Max;
    CGNXEdit    m_editExpPdl2Min;
    CGNXEdit    m_editExpPdl2Max;
    CGNXEdit    m_editExpPdl3Min;
    CGNXEdit    m_editExpPdl3Max;

    // LFO 1  LFO 2
    CComboBox   m_cmbLFO1;
    CComboBox   m_cmbLFO2;
    CGNXEdit    m_editLFO1Min;
    CGNXEdit    m_editLFO1Max;
    CComboBox   m_cmbLFO1WavFrm;
    CGNXEdit    m_editLFO1Speed;
    CGNXEdit    m_editLFO2Min;
    CGNXEdit    m_editLFO2Max;
    CComboBox   m_cmbLFO2WavFrm;
    CGNXEdit    m_editLFO2Speed;

    // CONTROL A
    CComboBox   m_cmbCtrlALink1Type;
    CGNXEdit    m_editCtrlALink1Min;
    CGNXEdit    m_editCtrlALink1Max;
    CComboBox   m_cmbCtrlALink2Type;
    CGNXEdit    m_editCtrlALink2Min;
    CGNXEdit    m_editCtrlALink2Max;
    CComboBox   m_cmbCtrlALink3Type;
    CGNXEdit    m_editCtrlALink3Min;
    CGNXEdit    m_editCtrlALink3Max;
    CButton     m_radioCtrlAToggle;
    int         m_iRadioCtrlAMomentary;

    // CONTROL B
    CComboBox   m_cmbCtrlBLink1Type;
    CComboBox   m_cmbCtrlBLink2Type;
    CComboBox   m_cmbCtrlBLink3Type;
    CGNXEdit    m_editCtrlBLink1Min;
    CGNXEdit    m_editCtrlBLink1Max;
    CGNXEdit    m_editCtrlBLink2Min;
    CGNXEdit    m_editCtrlBLink2Max;
    CGNXEdit    m_editCtrlBLink3Min;
    CGNXEdit    m_editCtrlBLink3Max;

    // CONTROL C
    CComboBox   m_cmbCtrlCLink1Type;
    CComboBox   m_cmbCtrlCLink2Type;
    CComboBox   m_cmbCtrlCLink3Type;
    CGNXEdit    m_editCtrlCLink1Min;
    CGNXEdit    m_editCtrlCLink1Max;
    CGNXEdit    m_editCtrlCLink2Min;
    CGNXEdit    m_editCtrlCLink2Max;
    CGNXEdit    m_editCtrlCLink3Min;
    CGNXEdit    m_editCtrlCLink3Max;
};

#ifndef _DEBUG  // debug version in RealGNX4LibView.cpp
inline CRealGNX4LibDoc* CRealGNX4LibView::GetDocument() const
   { return reinterpret_cast<CRealGNX4LibDoc*>(m_pDocument); }
#endif

